use crate::entity::cms_article;
use ane_macros::{model_fetch, model_list};

use sea_orm::{
    ActiveModelTrait, ColumnTrait, DbConn, DbErr, DerivePartialModel, EntityTrait, FromQueryResult,
    ModelTrait, PaginatorTrait, PartialModelTrait, QueryFilter, QueryOrder, QueryTrait, Set,
};

/// cms的管里接口
pub struct Cms;

#[allow(unused)]
impl Cms {
    model_list!(
        #model=cms_article
        /// 文章列表
        pub fn list_article()
    );

    model_fetch!(
        #model=cms_article
        #filter=[Status.eq(1)]
        /// 获取一篇文章
        pub fn fetct_article(Id.eq(id:i32))
    );
}
